<!--
use CsMarca;
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<?
require_once '../Negocio/CsMarca.php';

function Guardar(){
    $marca = new CsMarca();
    $marca->dato[1] =$_POST['t_nom'];
    $trans = $marca->GuardarDato();
    if($trans == 0)
        echo"ERROR AL GUARDAR...!!!";
    else {
        echo"REGISTRO GUARDADO...!!!";
    }
    
}

if($_POST['b_guardar']=="Guardar"){
    Guardar();
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <form name="f_marca" method="post" action="">
        <table width="600" height="100" border="0" align="center">
            <tr><td width="70" colspan="3">Marca de Equipos: </td></tr>
            <tr>
                <td width="100" >Marca:</td>
                <td width="300" colspan="2"><input name="t_nom" type="text" id="marca" size="25"></td>
            </tr>
            <tr>
                <td width="200"><div align="center"><input type="submit" name="b_guardar" value="Guardar"></div></td>
                 <td width="200"><div align="center"><input type="submit" name="b_Editar" value="Editar"></div></td>
                 <td width="200"><div align="center"><input type="submit" name="b_Eliminar" value="Eliminar"></div></td>
            </tr>
        </table>
        </form></br>
        <?php
        $marca = new CsMarca();
        $ds = $marca->TraerDatos();?>
        <table width="600" height="100" border="0" align="center">
            <tr>
                <td>CODIGO</td>
                <td>MARCA</td>
            </tr><?$con = 0;
        while ($rows = mysql_fetch_array($ds)){
            $con++;?>
            <tr><td class="fila<? echo $con%2; ?>"><? echo $rows[0]; ?></td>
            <td class="fila<? echo $con%2; ?>"><? echo $rows[1]; ?></td></tr><?
        }?>
        </table><?
        // put your code here
        ?>
    </body>
</html>
